!(function(e, t) {
  typeof exports === 'object' && typeof module === 'object' ? module.exports = t() : typeof define ===
  // eslint-disable-next-line no-undef
  'function' && define.amd ? define('DHPlayer', [], t) : typeof exports === 'object' ? exports.DHPlayer =
    t() : e.DHPlayer = t()
}(typeof self !== 'undefined' ? self : this, function() {
  return (function(e) {
    function t(o) {
      if (n[o]) return n[o].exports
      var i = n[o] = {
        i: o,
        l: !1,
        exports: {}
      }
      // eslint-disable-next-line no-return-assign,no-sequences
      return e[o].call(i.exports, i, i.exports, t), i.l = !0, i.exports
    }
    var n = {}
    // eslint-disable-next-line no-return-assign,no-sequences
    return t.m = e, t.c = n, t.d = function(e, n, o) {
      t.o(e, n) || Object.defineProperty(e, n, {
        configurable: !1,
        enumerable: !0,
        get: o
      })
    }, t.n = function(e) {
      var n = e && e.__esModule ? function() {
        return e.default
      } : function() {
        return e
      }
      // eslint-disable-next-line no-sequences
      return t.d(n, 'a', n), n
    }, t.o = function(e, t) {
      return Object.prototype.hasOwnProperty.call(e, t)
    }, t.p = '/dist/', t(t.s = 1)
  }([function(e, t, n) {
    'use strict'

    function o(e) {
      return function() {
        var t = e.apply(this, arguments)
        return new Promise(function(e, n) {
          function o(i, s) {
            try {
              var r = t[i](s)
              var d = r.value
            } catch (e) {
              return void n(e)
            }
            if (!r.done) {
              return Promise.resolve(d).then(function(e) {
                o('next', e)
              }, function(e) {
                o('throw', e)
              })
            }
            e(d)
          }
          return o('next')
        })
      }
    }
    var i = n(9)
    var s = (n.n(i), n(10))
    var r = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? function(
      e) {
      return typeof e
    } : function(e) {
      return e && typeof Symbol === 'function' && e.constructor === Symbol && e !==
      Symbol.prototype ? 'symbol' : typeof e
    }
    var d = Object.assign || function(e) {
      for (var t = 1; t < arguments.length; t++) {
        var n = arguments[t]
        for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o])
      }
      return e
    }
    t.a = {
      name: 'DHPlayer',
      props: {
        videoId: {
          type: String,
          default: '1'
        },
        type: {
          type: Number,
          default: 1
        },
        realTimeList: {
          type: Array,
          default: function() {
            return []
          }
        },
        videoPlayList: {
          type: Array,
          default: function() {
            return []
          }
        },
        pathList: {
          type: Array,
          default: function() {
            return []
          }
        },
        windowType: {
          type: Number,
          default: 0
        },
        num: {
          type: Number,
          default: 1
        },
        connectTime: {
          type: Number,
          default: 60
        },
        outContent: {
          type: Object,
          default: function() {
            return {
              top: 0,
              left: 0
            }
          }
        },
        downloadUrl: {
          type: String,
          default: '/download/DHPlayer.zip'
        },
        showBar: {
          type: Boolean,
          default: !0
        },
        noTip: {
          type: Boolean,
          default: !1
        },
        shieldClass: {
          type: Array,
          default: function() {
            return []
          }
        }
      },
      data: function() {
        return {
          videoPlayer: null,
          playbackList: [],
          DHPVisible: !1,
          DHPUrl: this.downloadUrl,
          DHPVersion: '',
          upgradeDHP: !1,
          api: Object(s.a)(this),
          currentWindow: 0
        }
      },
      beforeDestroy: function() {
        this.destroy()
      },
      mounted: function() {
        this.initVideo()
      },
      methods: {
        destroy: function() {
          this.videoPlayer.destroy()
        },
        initVideo: function() {
          var e = this
          // eslint-disable-next-line no-sequences
          this.videoPlayer && this.destroy(), this.videoPlayer =
            // eslint-disable-next-line no-undef
            new VideoPlayer({
              videoId: this.videoId,
              windowType: this.windowType,
              connectTime: this.connectTime,
              shieldClass: this.shieldClass,
              showBar: this.showBar,
              num: Math.pow(Math.ceil(Math.sqrt(this.pathList
                .length || (this.type === 1 ? this
                .realTimeList.length : this
                .videoPlayList.length))), 2) || this.num,
              outContent: this.outContent,
              connectSuccess: function() {
                e.DHPVersion = window.dhPlayerControl
                  // eslint-disable-next-line no-sequences
                  .DHPlayerVersion, e.getVideoInfo(!0)
              },
              snapshotSuccess: function(t) {
                var n = t.base64Url
                var o = t.path
                e.$emit('picCap', {
                  base64Url: n,
                  path: o
                })
              },
              switchStartTime: function(t) {
                var n = t.startTime
                var o = t.snum
                var i = e.playbackList[o]
                if (i) {
                  if (i.request) {
                    var s = e.videoPlayList[o]
                    var r = s.endTime
                    if (n > r) {
                      return !e.noTip && e.$message
                        // eslint-disable-next-line no-sequences
                        .warning('开始时间不得大于结束时间'), e
                        .$emit('getError',
                          '开始时间不得大于结束时间'), !1
                    }
                    e.dealRecord(d({}, s, {
                      startTime: n
                    }), o)
                  } else {
                    var a = e.getUrlParam(i.path,
                      'endtime') - 0
                    if (n > a) {
                      return !e.noTip && e.$message
                        // eslint-disable-next-line no-sequences
                        .warning('开始时间不得大于结束时间'), e
                        .$emit('getError',
                          '开始时间不得大于结束时间'), !1
                    }
                    e.setPlayback(d({}, i, {
                      playStartTime: n
                    }), o)
                  }
                } e.$emit('switchStartTime', {
                  startTime: n,
                  snum: o
                })
              },
              replay: function(t) {
                e.$emit('replay', t)
              },
              videoDownloadSuccess: function(t) {
                // eslint-disable-next-line no-sequences
                !e.noTip && e.$message.success('本地录像已存到 ' + t),
                e.$emit('videoDownloadSuccess', t)
              },
              closeWindowSuccess: function(t) {
                var n = t.isAll
                var o = t.snum
                e.$emit('closeWindowSuccess', {
                  isAll: n,
                  snum: o
                })
              },
              getCurrentWindow: function(t) {
                // eslint-disable-next-line no-sequences
                e.currentWindow = t, e.$emit('getCurrentWindow',
                  t)
              },
              connectClose: function() {
                // eslint-disable-next-line no-sequences
                e.videoPlayer = null, e.getVideoInfo(!1)
              },
              createSuccess: function(t) {
                // eslint-disable-next-line no-sequences
                e.showBar || e.setShowBar(!1), e.pathList
                  .length ? e.loadVideo() : e.getRTSPURL()
              }
            })
        },
        getUrlParam: function(e, t) {
          var n = new RegExp('(^|&)' + t + '=([^&]*)(&|$)')
          var o = e.match(n)
          return o != null ? unescape(o[2]) : null
        },
        setShowBar: function(e) {
          this.videoPlayer.showControlBar(e)
        },
        loadVideo: function() {
          var e = this
          if (this.type === 1) {
            this.pathList.forEach(function(t, n) {
              var o = {
                snum: n
              }
              if (typeof t === 'string') o.path = t
              else {
                if ((void 0 === t ? 'undefined' : r(t)) !==
                'object') return t
                o = d({}, o, t)
              }
              e.setRealTime(o)
            })
          } else {
            var t = []
            this.pathList.forEach(function(n, o) {
              t.push(d({}, n, {
                request: !1
                // eslint-disable-next-line no-sequences
              })), e.setPlayback(n, o)
              // eslint-disable-next-line no-sequences
            }), this.playbackList = t
          }
        },
        getRTSPURL: function() {
          var e = this
          var t = 1
          this.type === 1 ? (t = this.realTimeList.length >= 4 ? 2 : 1, this
            .realTimeList.forEach(function(n, o) {
              e.api.fetchRealRTSP({
                data: {
                  streamType: n.streamType || t,
                  channelId: n.channelId,
                  dataType: n.dataType || 1
                }
              }).then(function(t) {
                if (t.url) {
                  var i = e.dealUrl(t)
                  e.setRealTime({
                    path: i,
                    redirect: typeof n
                      .redirect ===
                    'boolean' ? n
                        .redirect : i
                        .indexOf(
                          ':9090') !== -1,
                    snum: o
                  })
                }
              })
            })) : (t = this.videoPlayList.length >= 4 ? 2 : 1, this
            .videoPlayList.forEach(function(t, n) {
              e.dealRecord(t, n)
            }))
        },
        dealRecord: function(e, t) {
          var n = this
          // eslint-disable-next-line no-undef
          return o(regeneratorRuntime.mark(function o() {
            var i, s, r, a
            // eslint-disable-next-line no-undef
            return regeneratorRuntime.wrap(function(o) {
              for (;;) {
                switch (o.prev = o.next) {
                  case 0:
                    // eslint-disable-next-line no-return-assign,no-sequences
                    return o.next = 2, n.api
                      .fetchRecord({
                        data: d({}, e, {
                          streamType: e
                            .streamType ||
                          // eslint-disable-next-line no-undef
                          streamType
                        })
                      })
                  case 2:
                    // eslint-disable-next-line no-sequences
                    if (i = o.sent, !i
                      .records || !i.records
                      .length) {
                      o.next = 8
                      break
                    }
                    // eslint-disable-next-line no-return-assign,no-sequences
                    return o.next = 6, n.api
                      .fetchRTSP({
                        data: d({}, e, {
                          streamType: e
                            .streamType ||
                          // eslint-disable-next-line no-undef
                          streamType,
                          dataType: e
                            .dataType ||
                          1
                        })
                      })
                  case 6:
                    // eslint-disable-next-line no-sequences
                    s = o.sent, s.url && (r = n
                      .dealUrl(s), a =
                    d({}, e, {
                      path: r,
                      redirect: typeof e
                        .redirect ===
                      'boolean'
                        ? e
                          .redirect
                        : r
                          .indexOf(
                            ':9090'
                          ) !==
                        -1,
                      records: i
                        .records
                    }), n
                      .setPlayback(a, t),
                    n.playbackList[t] =
                      d({}, a, {
                        request: !0
                      }))
                  // eslint-disable-next-line no-fallthrough
                  case 8:
                  case 'end':
                    return o.stop()
                }
              }
            }, o, n)
          }))()
        },
        setRealTime: function(e) {
          this.videoPlayer.realmonitor(d({}, e))
        },
        setPlayback: function(e) {
          var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[
            1] : 0
          this.videoPlayer.playback({
            snum: t,
            records: e.records || [],
            path: e.url || e.path,
            startTime: e.startTime,
            endTime: e.endTime,
            redirect: e.redirect,
            playStartTime: e.playStartTime || e.startTime,
            playEndTime: e.playEndTime || e.endTime
          })
        },
        dealUrl: function(e) {
          var t = e.url
          // eslint-disable-next-line no-return-assign
          return t = t.includes('|') ? t.split('|').map(function(t) {
            return t + '?token=' + e.token
          }).reverse().join('|') : t + '?token=' + e.token
        },
        hiddenDhp: function() {
          window.DHPVisible = this.DHPVisible = !1
        },
        hideWindow: function(e) {
          this.videoPlayer.hide(e)
        },
        showWindow: function(e) {
          this.videoPlayer.show(e)
        },
        windowShield: function(e) {
          this.videoPlayer.windowShield(e)
        },
        getVideoInfo: function(e) {
          var t = this
          this.api.videoInfo().then(function(n) {
            // eslint-disable-next-line no-sequences
            t.DHPUrl = n.url, n.version && (n.version = '000000'),
            e && n.version > t.DHPVersion && (t.upgradeDHP = !0,
            !window.DHPVisible && (window.DHPVisible = t
              .DHPVisible = !0)), e || !window
              .DHPVisible && (window.DHPVisible = t.DHPVisible = !0)
          }).catch(function(n) {
            e || !window.DHPVisible && (window.DHPVisible = t
              .DHPVisible = !0)
          })
        },
        downloadDhp: function() {
          // eslint-disable-next-line no-sequences
          window.location.href = this.DHPUrl, this.hiddenDhp()
        }
      }
    }
  }, function(e, t, n) {
    'use strict'
    Object.defineProperty(t, '__esModule', {
      value: !0
    })
    var o = n(2)
    var i = function(e) {
      arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
      e.component(o.a.name, o.a)
    }
    // eslint-disable-next-line no-sequences
    typeof window !== 'undefined' && window.Vue && i(window.Vue), o.a.install = i, t
      .default = o.a
  }, function(e, t, n) {
    'use strict'

    function o(e) {
      n(3)
    }
    var i = n(0)
    var s = n(11)
    var r = n(8)
    var d = o
    var a = r(i.a, s.a, !1, d, null, null)
    t.a = a.exports
  }, function(e, t, n) {
    var o = n(4)
    typeof o === 'string' && (o = [
      [e.i, o, '']
      // eslint-disable-next-line no-sequences
    ]), o.locals && (e.exports = o.locals)
    n(6)('3d677e0a', o, !0, {})
  }, function(e, t, n) {
    // eslint-disable-next-line no-sequences
    t = e.exports = n(5)(!1), t.push([e.i,
      '.dh-video-modal{width:100%}.dh-video-modal .ant-modal-content{border:1px solid #ffa302;background:#fff7e9;color:#ffa302}.dh-video-modal .message{display:flex;align-items:center}.dh-video-modal .ant-modal-close-x{display:none}.dh-video-modal .ant-modal-body{padding:0 20px;font-size:14px;word-wrap:break-word;height:40px;line-height:40px;margin-left:0}.dh-video-modal .messageIcon{background:#ffa302;border-radius:50%;color:#fff;font-size:16px;margin-right:5px}.dh-video-modal .Modalcontent a{margin-left:15px}',
      ''
    ])
  }, function(e, t) {
    function n(e, t) {
      var n = e[1] || ''
      var i = e[3]
      if (!i) return n
      if (t && typeof btoa === 'function') {
        var s = o(i)
        return [n].concat(i.sources.map(function(e) {
          return '/*# sourceURL=' + i.sourceRoot + e + ' */'
        })).concat([s]).join('\n')
      }
      return [n].join('\n')
    }

    function o(e) {
      return '/*# sourceMappingURL=data:application/json;charset=utf-8;base64,' + btoa(
        unescape(encodeURIComponent(JSON.stringify(e)))) + ' */'
    }
    e.exports = function(e) {
      var t = []
      // eslint-disable-next-line no-return-assign
      return t.toString = function() {
        return this.map(function(t) {
          var o = n(t, e)
          return t[2] ? '@media ' + t[2] + '{' + o + '}' : o
        }).join('')
        // eslint-disable-next-line no-sequences
      }, t.i = function(e, n) {
        typeof e === 'string' && (e = [
          [null, e, '']
        ])
        for (var o = {}, i = 0; i < this.length; i++) {
          var s = this[i][0]
          typeof s === 'number' && (o[s] = !0)
        }
        for (i = 0; i < e.length; i++) {
          var r = e[i]
          typeof r[0] === 'number' && o[r[0]] || (n && !r[2] ? r[2] = n : n &&
            (r[2] = '(' + r[2] + ') and (' + n + ')'), t.push(r))
        }
      }, t
    }
  }, function(e, t, n) {
    function o(e) {
      for (var t = 0; t < e.length; t++) {
        var n = e[t]
        var o = c[n.id]
        if (o) {
          o.refs++
          for (var i = 0; i < o.parts.length; i++) o.parts[i](n.parts[i])
          for (; i < n.parts.length; i++) o.parts.push(s(n.parts[i]))
          o.parts.length > n.parts.length && (o.parts.length = n.parts.length)
        } else {
          // eslint-disable-next-line no-redeclare
          for (var r = [], i = 0; i < n.parts.length; i++) r.push(s(n.parts[i]))
          c[n.id] = {
            id: n.id,
            refs: 1,
            parts: r
          }
        }
      }
    }

    function i() {
      var e = document.createElement('style')
      // eslint-disable-next-line no-return-assign,no-sequences
      return e.type = 'text/css', h.appendChild(e), e
    }

    function s(e) {
      var t
      var n
      var o = document.querySelector('style[' + y + '~="' + e.id + '"]')
      if (o) {
        if (f) return p
        o.parentNode.removeChild(o)
      }
      if (g) {
        var s = w++
        // eslint-disable-next-line no-sequences
        o = u || (u = i()), t = r.bind(null, o, s, !1), n = r.bind(null, o, s, !0)
      } else {
        // eslint-disable-next-line no-sequences
        o = i(), t = d.bind(null, o), n = function() {
          o.parentNode.removeChild(o)
        }
      }
      // eslint-disable-next-line no-sequences
      return t(e),
      function(o) {
        if (o) {
          if (o.css === e.css && o.media === e.media && o.sourceMap === e
            .sourceMap) return
          t(e = o)
        } else n()
      }
    }

    function r(e, t, n, o) {
      var i = n ? '' : o.css
      if (e.styleSheet) e.styleSheet.cssText = v(t, i)
      else {
        var s = document.createTextNode(i)
        var r = e.childNodes
        // eslint-disable-next-line no-sequences
        r[t] && e.removeChild(r[t]), r.length ? e.insertBefore(s, r[t]) : e.appendChild(
          s)
      }
    }

    function d(e, t) {
      var n = t.css
      var o = t.media
      var i = t.sourceMap
      // eslint-disable-next-line no-sequences
      if (o && e.setAttribute('media', o), m.ssrId && e.setAttribute(y, t.id), i && (n +=
        '\n/*# sourceURL=' + i.sources[0] + ' */', n +=
        '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(
          encodeURIComponent(JSON.stringify(i)))) + ' */'), e.styleSheet) {
        e
          .styleSheet.cssText = n
      } else {
        for (; e.firstChild;) e.removeChild(e.firstChild)
        e.appendChild(document.createTextNode(n))
      }
    }
    var a = typeof document !== 'undefined'
    // eslint-disable-next-line no-undef
    if (typeof DEBUG !== 'undefined' && DEBUG && !a) {
      throw new Error(
        "vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
      )
    }
    var l = n(7)
    var c = {}
    var h = a && (document.head || document.getElementsByTagName('head')[0])
    var u = null
    var w = 0
    var f = !1
    var p = function() {}
    var m = null
    var y = 'data-vue-ssr-id'
    var g = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent
      .toLowerCase())
    e.exports = function(e, t, n, i) {
      // eslint-disable-next-line no-sequences
      f = n, m = i || {}
      var s = l(e, t)
      // eslint-disable-next-line no-sequences
      return o(s),
      function(t) {
        for (var n = [], i = 0; i < s.length; i++) {
          var r = s[i]
          var d = c[r.id]
          // eslint-disable-next-line no-sequences
          d.refs--, n.push(d)
        }
        t ? (s = l(e, t), o(s)) : s = []
        // eslint-disable-next-line no-redeclare
        for (var i = 0; i < n.length; i++) {
          // eslint-disable-next-line no-redeclare
          var d = n[i]
          if (d.refs === 0) {
            for (var a = 0; a < d.parts.length; a++) d.parts[a]()
            delete c[d.id]
          }
        }
      }
    }
    var v = (function() {
      var e = []
      return function(t, n) {
        // eslint-disable-next-line no-return-assign,no-sequences
        return e[t] = n, e.filter(Boolean).join('\n')
      }
    }())
  }, function(e, t) {
    e.exports = function(e, t) {
      for (var n = [], o = {}, i = 0; i < t.length; i++) {
        var s = t[i]
        var r = s[0]
        var d = s[1]
        var a = s[2]
        var l = s[3]
        var c = {
          id: e + ':' + i,
          css: d,
          media: a,
          sourceMap: l
        }
        o[r] ? o[r].parts.push(c) : n.push(o[r] = {
          id: r,
          parts: [c]
        })
      }
      return n
    }
  }, function(e, t) {
    e.exports = function(e, t, n, o, i, s) {
      var r
      var d = e = e || {}
      var a = typeof e.default
      a !== 'object' && a !== 'function' || (r = e, d = e.default)
      var l = typeof d === 'function' ? d.options : d
      t && (l.render = t.render, l.staticRenderFns = t.staticRenderFns, l
        // eslint-disable-next-line no-sequences
        ._compiled = !0), n && (l.functional = !0), i && (l._scopeId = i)
      var c
      if (s ? (c = function(e) {
        e = e || this.$vnode && this.$vnode.ssrContext || this.parent &&
          // eslint-disable-next-line no-sequences
          this.parent.$vnode && this.parent.$vnode.ssrContext, e ||
        typeof __VUE_SSR_CONTEXT__ === 'undefined' || (e =
          // eslint-disable-next-line no-undef
          __VUE_SSR_CONTEXT__), o && o.call(this, e), e && e
          ._registeredComponents && e._registeredComponents.add(s)
        // eslint-disable-next-line no-sequences
      }, l._ssrRegister = c) : o && (c = o), c) {
        var h = l.functional
        var u = h ? l.render : l.beforeCreate
        h ? (l._injectStyles = c, l.render = function(e, t) {
          // eslint-disable-next-line no-sequences
          return c.call(t), u(e, t)
        }) : l.beforeCreate = u ? [].concat(u, c) : [c]
      }
      return {
        esModule: r,
        exports: d,
        options: l
      }
    }
  }, function(e, t) {
    !(function() {
      function e() {
        var e = window.top.innerWidth
        var t = window.top.innerHeight
        var o = n()
        return {
          width: e * o / 100,
          height: t * o / 100
        }
      }

      function t(e, t) {
        var n = new RegExp('(^|&)' + t + '=([^&]*)(&|$)')
        var o = e.match(n)
        return o != null ? unescape(o[2]) : null
      }

      function n() {
        var e = 0
        var t = window.screen
        var n = navigator.userAgent.toLowerCase()
        // eslint-disable-next-line no-return-assign
        return void 0 !== window.devicePixelRatio ? e = window.devicePixelRatio : ~n
          .indexOf('msie') ? t.deviceXDPI && t.logicalXDPI && (e = t.deviceXDPI /
          t.logicalXDPI) : void 0 !== window.outerWidth && void 0 !== window
          // eslint-disable-next-line no-sequences
            .innerWidth && (e = window.outerWidth / window.innerWidth), e && (e =
          Math.round(100 * e)), e
      }

      function o() {
        var e = document.createElement('iframe')
        // eslint-disable-next-line no-sequences
        e.style.display = 'none', e.src = 'DHPlayer://', document.body.appendChild(
          e), setTimeout(function() {
          document.body.removeChild(e)
        }, 3e3)
      }

      function i() {
        var e = this
        setTimeout(function() {
          sessionStorage.getItem('HikCentralWebControlPort') || (window
            .dhPlayerControl.wsConnect = !1, window.dhPlayerControl
            .windowState = 'wsFail', window.dhPlayerControl
            .noCardPlayerFlag = !0, e.setting.connectClose && e
            .setting.connectClose())
        }, 1e3 * e.setting.connectTime)
      }

      function s() {
        function e(e) {
          window.dhPlayerControl.DHPlayerVersion = Number(e.data.ver)
          var t = sessionStorage.getItem('HikCentralWebControlPort')
          // eslint-disable-next-line no-sequences
          h['ws' + t].close(), p = !0, r()
        }

        function t(e) {
          var t = e.target.url.split(':').length === 3 ? e.target.url.split(':')[2]
            .replace('/', '') : '80'
          var n = {
            method: 'common.version',
            info: {},
            id: w,
            session: window.dhPlayerControl.wsSession
          }
          h['ws' + t] && h['ws' + t].readyState === 1 && h['ws' + t].send(JSON
            .stringify(n))
        }

        function n(e) {
          u++
          var t = e.target.url.split(':').length === 3 ? e.target.url.split(':')[2]
            .replace('/', '') : '80'
          // eslint-disable-next-line no-sequences
          h['ws' + t].close(), window.dhPlayerControl.noCardPlayerFlag || (f =
            f === c - 1 ? 0 : f + 1, s()), u === c && (window.dhPlayerControl
            .openPlayerFlag || (window.dhPlayerControl.openPlayerFlag = !0,
          o()))
        }

        function i(t) {
          var o = t && t.data ? JSON.parse(t.data) : {}
          if (o.id === w) {
            window.dhPlayerControl.openPlayerFlag = !0
            var i = t.target.url.split(':').length === 3 ? t.target.url.split(
              ':')[2].replace('/', '') : '80'
            sessionStorage && sessionStorage.setItem('HikCentralWebControlPort',
              // eslint-disable-next-line no-sequences
              i), a[d[f]] = 1, e(o)
          } else n(t)
        }

        function s() {
          // eslint-disable-next-line no-sequences
          h['ws' + d[f]] = new WebSocket('ws://localhost:' + d[f]), h['ws' + d[f]]
            .onopen = t, h['ws' + d[f]].onerror = n, h['ws' + d[f]].onmessage =
            i
        }
        if (!window.dhPlayerControl.noCardPlayerFlag) {
          if (typeof WebSocket === 'undefined') {
            return void alert(
              '您的浏览器不支持socket')
          }
          sessionStorage.getItem('HikCentralWebControlPort') && sessionStorage
            .removeItem('HikCentralWebControlPort')
          for (var d = [], a = {}, l = 8e3; l <= 8004; l++) d.push(l)
          var c = d.length
          var h = {}
          var u = 0
          var w = 0
          var f = 0
          var p = !1
          window.dhPlayerControl.socketTimer && window.clearTimeout(window
            // eslint-disable-next-line no-sequences
            .dhPlayerControl.socketTimer), window.dhPlayerControl
            .windowState = 'wsPending', s(), window.dhPlayerControl
            .socketTimer = setTimeout(function() {
              if (!p) {
                for (var e = 0, t = 0; t < d.length; t++) {
                  a[d[f]] !==
                  // eslint-disable-next-line no-sequences
              1 && e++, e === d.length && (window.dhPlayerControl
                    .openPlayerFlag || (window.dhPlayerControl
                    .openPlayerFlag = !0, o()))
                }
              }
            }, 2e4)
        }
      }

      function r() {
        var e = sessionStorage.getItem('HikCentralWebControlPort')
        // eslint-disable-next-line no-sequences
        window.dhPlayerControl.videoWS = new WebSocket('ws:127.0.0.1:' + e), window
          .dhPlayerControl.videoWS.onopen = function() {
            window.dhPlayerControl.windowState = 'wsSuccess'
            for (var e in window.dhPlayerControl.videoList) {
              var t = window.dhPlayerControl.videoList[e]
              // eslint-disable-next-line no-sequences
              t && t.setting.connectSuccess(), t.create()
            }
          }, window.dhPlayerControl.videoWS.onerror = r, window.dhPlayerControl
          .videoWS.onmessage = l
      }

      function d(e) {
        for (var t = atob(e), n = t.length, o = new Uint8Array(n); n--;) {
          o[n] = t
            .charCodeAt(n)
        }
        return new Blob([o], {
          type: 'image/jpeg'
        })
      }

      function a(e, t) {
        var n = d(e)
        return URL.createObjectURL(n)
      }

      function l(e) {
        if (e.data != null && e.data !== '') {
          var t = JSON.parse(e.data)
          if (t.info) {
            var n = window.dhPlayerControl.hwndList[t.info.hwnd]
            switch (t.method) {
              case 'web.seekRecord':
                n.switchStartTime && n.switchStartTime({
                  startTime: t.info.seekTime,
                  snum: t.info.snum
                })
                break
              case 'web.replay':
                n.replay && n.replay(t.info.snum)
                break
              case 'window.selected':
                // eslint-disable-next-line no-sequences
                n.snum = t.info.snum, n.getCurrentWindow && n
                  .getCurrentWindow(t.info.snum)
                break
              case 'video.close':
                // eslint-disable-next-line no-sequences
                n.snum = t.info.wndId, n.closeWindowSuccess && n
                  .closeWindowSuccess({
                    isAll: t.info.isAll,
                    snum: n.snum
                  })
                break
              case 'talk.close':
                // eslint-disable-next-line no-sequences
                n.snum = t.info.wndId, n.closeTalkSuccess && n
                  .closeTalkSuccess({
                    isAll: t.info.isAll,
                    snum: n.snum
                  })
                break
              case 'web.captureCallBack':
                var o = t.info.PicBuf ? a(t.info.PicBuf) : ''
                n.snapshotSuccess && n.snapshotSuccess({
                  base64Url: t.info.PicBuf,
                  path: o
                })
                break
              case 'window.LocalRecordFinish':
                n.videoDownloadSuccess && n.videoDownloadSuccess(t.info
                  .path)
            }
          }
          var i = null
          var s = null
          if (window.dhPlayerControl.callBackList[t.id] && (i = window
            .dhPlayerControl.callBackList[t.id].onError, s = window
            // eslint-disable-next-line no-sequences
            .dhPlayerControl.callBackList[t.id].onSuccess), t.code !== 0) {
            return void (i && typeof i === 'function' && (i(t), delete window
              .dhPlayerControl.callBackList[t.id]))
          }
          // eslint-disable-next-line no-sequences
          window.dhPlayerControl.wsSession = t.session, s && typeof s ===
          'function' && (s(t), delete window.dhPlayerControl.callBackList[t
            .id])
        }
      }

      function c(e, t) {
        ['window.change', 'window.shield'].includes(e.method) || console.log('web',
          // eslint-disable-next-line no-sequences
          JSON.stringify(e)), window.dhPlayerControl.videoWS && window
          .dhPlayerControl.videoWS.readyState === 1 && window.dhPlayerControl
          .videoWS.send(JSON.stringify(e))
      }

      function h() {
        // eslint-disable-next-line no-sequences
        window.dhPlayerControl.videoWS && window.dhPlayerControl.videoWS.close(),
        window.dhPlayerControl.videoWS = null, window.wsHeart = clearInterval(
          window.wsHeart)
      }

      function u() {
        var e = (function() {
          var e
          var t = {}
          var n = navigator.userAgent.toLowerCase()
          // eslint-disable-next-line no-cond-assign,no-return-assign
          return (e = n.match(/edge\/([\d.]+)/)) ? t.edge = e[1] : (e = n
            // eslint-disable-next-line no-cond-assign
            .match(/rv:([\d.]+)\) like gecko/)) ? t.ie = e[1] : (e =
            // eslint-disable-next-line no-cond-assign
            n.match(/msie ([\d.]+)/)) ? t.ie = e[1] : (e = n.match(
                // eslint-disable-next-line no-cond-assign
                /firefox\/([\d.]+)/)) ? t.firefox = e[1] : (e = n.match(
                  // eslint-disable-next-line no-cond-assign
                  /chrome\/([\d.]+)/)) ? t.chrome = e[1] : (e = n.match(
                    /opera.([\d.]+)/)) ? t.opera = e[1] : (e = n.match(
                      // eslint-disable-next-line no-sequences
                      /version\/([\d.]+).*safari/)) && (t.safari = e[1]), t
            .edge ? {
              broswer: 'Edge',
              version: t.edge
            } : t.ie ? {
              broswer: 'IE',
              version: t.ie
            } : t.firefox ? {
              broswer: 'Firefox',
              version: t.firefox
            } : t.chrome ? {
              broswer: 'Chrome',
              version: t.chrome
            } : t.opera ? {
              broswer: 'Opera',
              version: t.opera
            } : t.safari ? {
              broswer: 'Safari',
              version: t.safari
            } : {
              broswer: '',
              version: '0'
            }
        }())
        return e.broswer === 'IE' ? 0 : e.broswer === 'Chrome' ? 1 : e.broswer ===
        'Firefox' ? 2 : -1
      }

      function w(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1]
          : 'id'
        if (document.visibilityState === 'hidden') return !1
        var n = null
        if (n = t === 'class' ? document.getElementsByClassName(e)[0] : document
          // eslint-disable-next-line no-sequences
          .getElementById(e), !e || !n) {
          return t === 'id' && (this.setting
            // eslint-disable-next-line no-sequences
            .visible = !1), !1
        }
        var o = document.documentElement.clientWidth
        var i = document.documentElement.clientHeight
        var s = f.call(this, t === 'id' ? '' : e)
        var r = s.left
        var d = s.top
        var a = s.right
        var l = s.bottom
        if (d >= i || l <= 0 || a <= 0 || r >= o) {
          return t === 'id' && (this.setting
            // eslint-disable-next-line no-sequences
            .visible = !1), !1
        }
        for (var c = !0, h = getComputedStyle(n).display !== 'none' &&
          getComputedStyle(n).visibility !== 'hidden'; c && h;) {
          n = n
            // eslint-disable-next-line no-sequences
            .parentNode, n && n !== document.body ? h = getComputedStyle(n)
            .display !== 'none' && getComputedStyle(n).visibility !== 'hidden' : c = !1
        }
        // eslint-disable-next-line no-sequences
        return t === 'id' && (this.setting.visible = h), h
      }

      function f(e) {
        var t = ''
        var o = this.setting.videoId
        if (!(t = e ? document.getElementsByClassName(e)[0] : document
          .getElementById(o))) return {}
        for (var i = t.getBoundingClientRect(), s = n(), r = 0, d = 0, a = 0, l = 0,
          c = window.parent.document.getElementsByTagName('iframe'), h = null,
          u = 0; u < c.length; u++) {
          if (e ? c[u].contentWindow.document.getElementsByClassName(e)[0] : c[u]
            .contentWindow.document.getElementById(o)) {
            h = c[u]
            break
          }
        }
        if (h) {
          var w = h.getBoundingClientRect()
          // eslint-disable-next-line no-sequences
          r = w.left, d = w.top, l = (this.setting.outContent.width || w.width) *
            s / 100, a = (this.setting.outContent.height || w.height) * s / 100
        }
        var f = i.left + (this.setting.outContent.left || r)
        var p = i.top + (this.setting.outContent.top || d)
        // eslint-disable-next-line no-return-assign,no-sequences
        return f = f * s / 100, p = p * s / 100, i.width = i.width * s / 100, i
          .height = i.height * s / 100, {
          left: f,
          top: p,
          right: f + i.width,
          bottom: p + i.height,
          outLeft: (this.setting.outContent.left || r) * s / 100,
          outTop: (this.setting.outContent.top || d) * s / 100,
          outWidth: l,
          outHeight: a,
          width: i.width,
          height: i.height
        }
      }
      window.dhPlayerControl = Object.assign({
        videoWS: null,
        wsConnectCount: 0,
        wsSession: '',
        windowState: '',
        videoList: {},
        hwndList: {},
        callBackList: {},
        wsConnect: !1
      }, window.dhPlayerControl || {}, {
        socketTimer: null,
        openPlayerFlag: !1,
        noCardPlayerFlag: !1,
        DHPlayerVersion: ''
        // eslint-disable-next-line no-extend-native,no-sequences
      }), Function.prototype.myBind = function(e) {
        var t = this
        var n = Array.prototype.slice.call(arguments, 1)
        return 'bind' in Function.prototype ? t.bind(e, n) : function() {
          t.apply(e, n)
        }
      }, document.getElementsByClassName || (document.getElementsByClassName =
        function(e, t) {
          for (var n = (t || document).getElementsByTagName('*'), o =
            // eslint-disable-next-line no-array-constructor
            new Array(), i = 0; i < n.length; i++) {
            for (var s = n[i], r = s.className.split(' '), d = 0; d < r
              .length; d++) {
              if (r[d] === e) {
                o.push(s)
                break
              }
            }
          } return o
        })
      var p = function e(t) {
        if (!t) throw new Error('请传入配置参数')
        // eslint-disable-next-line new-cap
        if (!(this instanceof e)) return new e(t)
        var n = {
          isIE: !!window.ActiveXObject || 'ActiveXObject' in window,
          videoId: 'DHVideoPlayer',
          windowType: 0,
          outContent: {
            left: 0,
            right: 0,
            width: 0,
            height: 0
          },
          show: !0,
          connectTime: 60,
          connectSuccess: null,
          connectError: null,
          connectClose: null,
          option_id: {},
          heartCount: 0,
          refreshTimer: null,
          browserType: 1,
          isDestroy: !1,
          version: 0,
          stopRefresh: !1,
          visible: !1,
          showBar: !0,
          hwnd: '',
          snum: 0,
          mount: !0,
          num: 1
        }
        // eslint-disable-next-line no-sequences
        if (this.setting = Object.assign({}, n, t), n.isIE) {
          var o = document.getElementById(this.setting.videoId)
          this.setting.ieDom = this.setting.videoId + '_box'
          var i = document.createElement('object')
          // eslint-disable-next-line no-sequences
          i.setAttribute('id', this.setting.ieDom), i.setAttribute('classid',
            'clsid:1e68fa30-f1b5-4bbe-b483-8caaa2a3995a'), i.style
            .width = '100%', i.style.height = '100%', o.appendChild(i)
        }
        // eslint-disable-next-line no-sequences
        this.adjustCount = 0, this.focus = !1, this.init()
      }
      p.fn = p.prototype = {
        onbeforeunload: function() {
          // eslint-disable-next-line no-sequences
          this.destroy(), h()
        },
        send: function(e, t) {
          t && Object.keys(t).length && (window.dhPlayerControl
            // eslint-disable-next-line no-sequences
            .callBackList[e.id] = t), this.setting.isIE ? this
            .MainCall(e) : c.call(this, e)
        },
        create: function() {
          var t = arguments.length > 0 && void 0 !== arguments[0]
            ? arguments[0] : {
              onSuccess: this.setting.createSuccess,
              onError: this.setting.createError
            }
          var n = f.call(this)
          var o = Object.assign({}, {}, n)
          var i = e()
          // eslint-disable-next-line no-sequences
          o.num = this.setting.num, o.toolBar = this.setting.showBar ? 1
            : 0, o.windowType = this.setting.windowType, o.browserType =
            this.setting.browserType, o.clientAreaHeight = i.height, o
            .clientAreaWidth = i.width
          var s = this
          this.send({
            method: 'window.create',
            info: o,
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, {
            onSuccess: function(e) {
              if (e.data && e.data.hwnd != null) {
                var n = e.data.hwnd
                // eslint-disable-next-line no-sequences
                s.setting.hwnd = n, window
                  .dhPlayerControl.hwndList[n] = s
                    .setting
              }
              window.addEventListener('beforeunload', s
                // eslint-disable-next-line no-sequences
                .onbeforeunload.myBind(s)), document
                .addEventListener('click', s.setTop
                  .myBind(s)), s.handleAdjust(),
              document.addEventListener(
                'visibilitychange', s.setVisible
                  .myBind(s), !0), t.onSuccess && t
                .onSuccess(e)
            },
            onError: function() {
              // eslint-disable-next-line no-undef
              t.onError && t.onError(data)
            }
          })
        },
        setVisible: function() {
          document.visibilityState === 'hidden' ? this.hide() : w.call(
            this, this.setting.videoId) && this.show()
        },
        setTop: function() {
          // eslint-disable-next-line no-sequences
          this.focus = !0, !this.setting.isDestroy && this
            .browserFocusBlur()
        },
        browserFocusBlur: function(e, t) {
          var n = this.extendOption(['hwnd', 'snum', 'show'], e)
          this.send({
            method: 'browserFocusBlur',
            info: {
              hwnd: n.hwnd,
              browserType: this.setting.browserType,
              show: this.setting.show,
              focus: this.focus
            },
            session: window.dhPlayerControl.wsSession
          }, t)
        },
        handleAdjust: function() {
          if (!this.setting.stopRefresh && !this.setting.isDestroy) {
            var e = this
            this.adjustCount % 5 ? this.adjustCount++ : (this
              .adjustCount = 1, this.changePosition(), this
              // eslint-disable-next-line no-sequences
              .windowShield(this.cover())), this.setting
              .refreshTimer = window.requestAnimationFrame(
                function() {
                  return e.handleAdjust()
                })
          }
        },
        destroy: function(e) {
          var t = this.extendOption(['hwnd'])
          this.send({
            method: 'window.destroy',
            info: {
              hwnd: t.hwnd,
              browserType: this.setting.browserType
            },
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
            // eslint-disable-next-line no-sequences
          }, e), this.setting.isDestroy = !0, document
            .removeEventListener('click', this.setTop.myBind(this)),
          document.removeEventListener('visibilitychange', this
            .setVisible.myBind(this), !0), window
            .removeEventListener('beforeunload', this.onbeforeunload
              .myBind(this))
        },
        chooseWindow: function(e) {
          var t = arguments.length > 1 && void 0 !== arguments[1]
            ? arguments[1] : {
              onSuccess: this.setting.chooseWindowSuccess,
              onError: this.setting.chooseWindowError
            }
          this.send({
            method: 'window.select',
            info: {
              hwnd: this.setting.hwnd,
              snum: e
            },
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
            // eslint-disable-next-line no-sequences
          }, t), this.windowShield(this.cover())
        },
        realmonitor: function(e) {
          var t = arguments.length > 1 && void 0 !== arguments[1]
            ? arguments[1] : {
              onSuccess: this.setting.realTimeSuccess,
              onError: this.setting.realTimeError
            }
          var n = this.extendOption(['hwnd', 'snum'], e)
          var o = {}
          // eslint-disable-next-line no-sequences
          o.hwnd = n.hwnd, o.snum = n.snum, o.path = n.path, o
            .browserType = this.setting.browserType, o.redirect =
            typeof n.redirect !== 'boolean' || n.redirect, this.send({
            method: 'video.realmonitor',
            info: o,
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, t), this.windowShield(this.cover())
        },
        talk: function(e, t) {
          var n = this.extendOption(['hwnd', 'snum'], e)
          // eslint-disable-next-line no-sequences
          n.browserType = this.setting.browserType, this.send({
            method: 'video.starttalk',
            info: n,
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, t), this.windowShield(this.cover())
        },
        playback: function(e) {
          var n = arguments.length > 1 && void 0 !== arguments[1]
            ? arguments[1] : {
              onSuccess: this.setting.playbackSuccess,
              onError: this.setting.playbackError
            }
          var o = this.extendOption(['hwnd', 'snum'], e)
          var i = {}
          // eslint-disable-next-line no-sequences
          if (i.hwnd = o.hwnd, i.snum = o.snum, i.path = o.path, i
            .records = o.records, i.startTime = o.startTime, i.endTime =
            o.endTime, i.playStartTime = o.playStartTime, i
            .playEndTime = o.playEndTime, i.browserType = this.setting
            .browserType, i.redirect = typeof o.redirect !==
            'boolean' || o.redirect, o.playStartTime) {
            var s = t(i.path, 'begintime')
            i.path = i.path.replace(s, o.playStartTime)
          }
          this.send({
            method: 'video.playback',
            info: i,
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
            // eslint-disable-next-line no-sequences
          }, n), this.windowShield(this.cover())
        },
        changePosition: function(t, n) {
          var o = this.extendOption(['hwnd'], t)
          var i = e()
          var s = f.call(this)
          var r = Object.assign({}, {}, s, o)
          // eslint-disable-next-line no-sequences
          r.browserType = this.setting.browserType, r.clientAreaHeight = i
            .height, r.clientAreaWidth = i.width, r.show = w.call(this,
            this.setting.videoId), this.send({
            method: 'window.change',
            info: r,
            session: window.dhPlayerControl.wsSession
          }, n)
        },
        hide: function() {
          var e = arguments.length > 0 && void 0 !== arguments[0]
            ? arguments[0] : {
              onSuccess: this.setting.hideWindowSuccess,
              onError: this.setting.hideWindowError
            }
          var t = this.extendOption(['hwnd'])
          // eslint-disable-next-line no-sequences
          this.setting.show = !1, this.setting.stopRefresh = !0, this
            .send({
              method: 'window.show',
              info: {
                hwnd: t.hwnd,
                show: !1,
                browserType: this.setting.browserType
              },
              id: window.dhPlayerControl.wsConnectCount++,
              session: window.dhPlayerControl.wsSession
            }, e)
        },
        show: function() {
          var e = this
          var t = this.extendOption(['hwnd'])
          // eslint-disable-next-line no-sequences
          this.setting.stopRefresh = !1, this.setting.show = !0, this
            .send({
              method: 'window.show',
              info: {
                hwnd: t.hwnd,
                show: !0,
                browserType: this.setting.browserType
              },
              id: window.dhPlayerControl.wsConnectCount++,
              session: window.dhPlayerControl.wsSession
            }, {
              onSuccess: function() {
                e.setting.refreshTimer && window
                  .cancelAnimationFrame(e.setting
                    // eslint-disable-next-line no-sequences
                    .refreshTimer), e.handleAdjust(), e
                  .setting.showWindowSuccess && e.setting
                  .showWindowSuccess()
              },
              onError: this.setting.showWindowError
            })
        },
        closeVideo: function(e) {
          var t = arguments.length > 1 && void 0 !== arguments[1]
            ? arguments[1] : {
              onSuccess: this.setting.closeVideoSuccess,
              onError: this.setting.closeVideoError
            }
          var n = this.extendOption(['hwnd', 'snum'], e)
          this.send({
            method: 'video.close',
            info: {
              hwnd: n.hwnd,
              snum: n.snum,
              isAll: e.isAll
            },
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, t)
        },
        closeTalk: function(e) {
          var t = arguments.length > 1 && void 0 !== arguments[1]
            ? arguments[1] : {
              onSuccess: this.setting.closeTalkSuccess,
              onError: this.setting.closeTalkError
            }
          var n = this.extendOption(['hwnd', 'snum'], e)
          this.send({
            method: 'video.closetalk',
            info: {
              hwnd: n.hwnd,
              snum: n.snum,
              isAll: e.isAll
            },
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, t)
        },
        controlPlayback: function(e) {
          var t = arguments.length > 1 && void 0 !== arguments[1]
            ? arguments[1] : {
              onSuccess: this.setting.controlPlaybackSuccess,
              onError: this.setting.controlPlaybackError
            }
          var n = this.extendOption(['hwnd', 'snum'], e)
          this.send({
            method: 'video.playbackChangeState',
            info: {
              hwnd: n.hwnd,
              snum: n.snum,
              state: e.state
            },
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, t)
        },
        showControlBar: function(e) {
          var t = this.extendOption(['hwnd'])
          this.send({
            method: 'video.setToolBarShow',
            info: {
              hwnd: t.hwnd,
              isShow: e ? 1 : 0,
              browserType: this.setting.browserType
            },
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          })
        },
        localRecordDownload: function(e) {
          var t = arguments.length > 1 && void 0 !== arguments[1]
            ? arguments[1] : {
              onSuccess: this.setting.recordDownloadSuccess,
              onError: this.setting.recordDownloadError
            }
          this.send({
            method: 'vidoe.localRecord',
            info: {
              hwnd: this.setting.hwnd,
              snum: e
            },
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, t)
        },
        snapshot: function(e) {
          this.send({
            method: 'video.snapic',
            info: {
              hwnd: this.setting.hwnd,
              snum: e
            },
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          })
        },
        windowShield: function(t, n) {
          var o = this.extendOption(['hwnd'], t)
          var i = e()
          var s = {}
          // eslint-disable-next-line no-sequences
          s.hwnd = o.hwnd, s.browserType = this.setting.browserType, s
            .region = this.getShieldRect(t), s.clientAreaHeight = i
            .height, s.clientAreaWidth = i.width, this.send({
            method: 'window.shield',
            info: s,
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, n)
        },
        version: function(e) {
          this.send({
            method: 'common.version',
            info: {},
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, e)
        },
        getWindowState: function(e) {
          var t = this.extendOption(['hwnd'])
          this.send({
            method: 'window.getWindowState',
            info: {
              hwnd: t.hwnd
            },
            id: window.dhPlayerControl.wsConnectCount++,
            session: window.dhPlayerControl.wsSession
          }, e)
        },
        cover: function() {
          var t
          var n
          var o
          var i
          var s = f.call(this)
          var r = e()
          var d = s.left
          var a = s.top
          var l = s.right
          var c = s.bottom + 1
          var h = s.width
          var u = s.height
          var w = s.outLeft
          var p = s.outTop
          var m = s.outWidth
          var y = s.outHeight
          var g = []
          // eslint-disable-next-line no-sequences
          d < w && (t = w - d, g.push(d, a, t, u)), a < p && (n = p - a, g
            .push(d, a, h, n))
          var v = m + w || r.width
          var C = y + p || r.height
          // eslint-disable-next-line no-return-assign,no-sequences
          return v - l < 0 && (o = v, t = l - o, g.push(o, a, t, u)), C -
          c < 0 && (n = c - C, g.push(d, C, h, n)), v - l < 0 && C -
          c < 0 && (t = l - o, n = c - C, g.push(v, C, t, n)), d <
          0 && a < 0 && (t = Math.abs(d), n = Math.abs(a), g.push(d,
            a, t, n)), v - l < 0 && a < 0 && (o = v, t = l - o,
          n = -a, g.push(o, a, t, n)), d < 0 && C - c < 0 && (i =
            C, t = -d, n = c - i, g.push(d, i, t, n)), g
        },
        extendOption: function(e, t) {
          for (var n = {}, o = 0; o < e.length; o++) {
            n[e[o]] = this
              .setting[e[o]]
          }
          return Object.assign({}, n, t)
        },
        getShieldRect: function(e) {
          for (var t, n = this.setting.shieldClass || [], o = e || [], i =
            0; i < n.length; i++) {
            w.call(this, n[i], 'class') && (
              t = f.call(this, n[i]), o.push(t.left, t.top, t.width, t
                .height))
          }
          return o
        },
        getOsInfo: function() {
          var e = window.navigator.userAgent.toLowerCase()
          return e.indexOf('win') > -1 ? e.indexOf('windows nt 5.0') > -1 || e.indexOf('Windows 2000') > -1 ? 'Windows 2000' : e
            .indexOf('windows nt 5.1') > -1 || e.indexOf('Windows XP') >
            -1 ? 'Windows XP' : e.indexOf('windows nt 5.2') > -1 || e
              .indexOf('Windows 2003') > -1 ? 'Windows 2003' : e.indexOf(
                'windows nt 6.0') > -1 || e.indexOf('Windows Vista') > -1 ? 'Windows Vista' : e.indexOf('windows nt 6.1') > -1 || e
                  .indexOf('windows 7') > -1 ? 'Windows 7' : e.indexOf(
                    'windows nt 6.2') > -1 || e.indexOf('windows 8') > -1
                    ? 'Windows 8' : e.indexOf('windows nt 6.3') > -1
                      ? 'Windows 8.1' : e.indexOf('windows nt 6.4') > -1 || e
                        .indexOf('windows nt 10') > -1 ? 'Windows 10' : 'Unknown'
            : e.indexOf('iphone') > -1 ? 'Iphone' : e.indexOf('mac') > -1 ? 'Mac' : e.indexOf('x11') > -1 || e.indexOf('unix') > -1 || e.indexOf('sunname') > -1 || e.indexOf('bsd') > -1
              ? 'Unix' : e.indexOf('linux') > -1 ? e.indexOf('android') > -1 ? 'Android' : 'Linux' : 'Unknown'
        },
        initConnect: function() {
          // eslint-disable-next-line no-sequences
          this.setting.connectSuccess(), this.create()
        },
        MainCall: function(e) {
          var t = document.getElementById(this.setting.ieDom)
          if (e.method === 'common.heartbeat') {
            if (++this.setting.heartCount >= 3) {
              // eslint-disable-next-line no-sequences,no-return-assign
              return t = null,
              void this.setting.connectClose()
            }
          } else this.setting.option_id[e.id] = e
          t && t.MainCall(e.method, JSON.stringify(e))
        },
        init: function() {
          var e = this
          this.setting.isIE ? this.initConnect() : window.dhPlayerControl
            .wsConnect ? window.dhPlayerControl.windowState ===
          'wsSuccess' ? (this.setting.connectSuccess && this.setting
                .connectSuccess(), e.create()) : window.dhPlayerControl
                .videoList[e.setting.videoId] = this : (window
              .dhPlayerControl.wsConnect = !0, window.dhPlayerControl
              .videoList[e.setting.videoId] = this, s.call(e), i.call(
            // eslint-disable-next-line no-sequences
              e)), this.setting.browserType = u()
        }
        // eslint-disable-next-line no-sequences
      }, window.VideoPlayer = window.VideoPlayer || p
    }())
  }, function(e, t, n) {
    'use strict'
    t.a = function(e) {
      return {
        videoInfo: function() {
          var t = e.resetAjax || function() {}
          return new Promise(function(e, n) {
            t({
              method: 'get',
              url: 'evo-brm/1.2.0/resources-info/get-resource?category=1&type=DHPlayer',
              isNoLock: !0,
              isSNoTip: !0,
              jumpLogin: !0,
              onSuccess: function(t) {
                e(t.data.data)
              },
              onError: function(e) {
                n(e)
              }
            })
          })
        },
        fetchRealRTSP: function(t) {
          var n = e.resetAjax || function() {}
          return new Promise(function(e, o) {
            n({
              method: 'post',
              url: 'admin/API/MTS/Video/StartVideo',
              isSNoTip: !0,
              jumpLogin: !0,
              data: t,
              onSuccess: function(t) {
                e(t.data.data)
              },
              onError: function(e) {
                o(e)
              }
            })
          })
        },
        fetchRTSP: function(t) {
          var n = e.resetAjax || function() {}
          return new Promise(function(e, o) {
            n({
              method: 'post',
              url: 'admin/API/SS/Playback/StartPlaybackByTime',
              isSNoTip: !0,
              data: t,
              onSuccess: function(t) {
                e(t.data.data)
              },
              onError: function(e) {
                o(e)
              }
            })
          })
        },
        fetchRecord: function(t) {
          var n = e.resetAjax || function() {}
          return new Promise(function(e, o) {
            n({
              method: 'post',
              url: 'admin/API/SS/Record/QueryRecords',
              isSNoTip: !0,
              data: t,
              onSuccess: function(t) {
                e(t.data.data)
              },
              onError: function(e) {
                o(e)
              }
            })
          })
        }
      }
    }
  }, function(e, t, n) {
    'use strict'
    var o = function() {
      var e = this
      var t = e.$createElement
      var n = e._self._c || t
      return n('div', [n('div', {
        attrs: {
          id: e.videoId
        }
      }), e._v(' '), e.noTip ? e._e() : n('div', [n('el-dialog', {
        staticClass: 'dh-video-modal',
        attrs: {
          footer: null,
          mask: !1,
          width: '280px'
        },
        model: {
          value: e.DHPVisible,
          callback: function(t) {
            e.DHPVisible = t
          },
          expression: 'DHPVisible'
        }
      }, [n('div', {
        staticClass: 'message'
      }, [n('a-icon', {
        staticClass: 'messageIcon',
        attrs: {
          type: 'exclamation'
        }
      }), e._v(' '), n('div', {
        staticClass: 'Modalcontent'
      }, [e.upgradeDHP ? n('span', [e._v(
        '视频插件已更新了~')]) : n('span', [e
        ._v('系统未检测到视频插件')
      ]), e._v(' '), n('a', {
        attrs: {
          href: '#'
        },
        on: {
          click: e.downloadDhp
        }
      }, [e.upgradeDHP ? n('span', [e
        ._v('更新插件')
      ]) : n('span', [e._v(
        '下载插件')])])])], 1)])], 1)])
    }
    var i = []
    var s = {
      render: o,
      staticRenderFns: i
    }
    t.a = s
  }]))
}))
